package com.demo.design.behavioral.mediator;

public abstract class Colleague {

    protected Mediator mediator;

    protected String name;

    public Colleague(String name, Mediator mediator) {
        this.name = name;
        this.mediator = mediator;
        this.mediator.register(this);
    }

    public Colleague(Mediator mediator) {
        this.mediator = mediator;
        this.mediator.register(this);
    }

    public void send(String msg) {
        mediator.transpond(this, msg);
    }

    public abstract void getNotice(String msg);
}
